//---------------------------------------------------------------------------
//
// Name:        Tac.cpp
// Author:      Retral
// Created:     6/7/2007 3:05:01 PM
// Description: Tac class implementation
//
//---------------------------------------------------------------------------

#include "Tac.h"
#include "TicTacToe.h"

//Do not add custom headers between
//Header Include Start and Header Include End
//wxDev-C++ designer will remove them
////Header Include Start
////Header Include End

//----------------------------------------------------------------------------
// Tac
//----------------------------------------------------------------------------
//Add Custom Events only in the appropriate block.
//Code added in other places will be removed by wxDev-C++
////Event Table Start
BEGIN_EVENT_TABLE(Tac,wxFrame)
	////Manual Code Start
	////Manual Code End
	
	EVT_CLOSE(Tac::OnClose)
	EVT_BUTTON(ID_WXBUTTON1,Tac::WxButton1Click)
END_EVENT_TABLE()
////Event Table End

Tac::Tac(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxFrame(parent, id, title, position, size, style)
{
	CreateGUIControls();
}

Tac::~Tac()
{
}

void Tac::CreateGUIControls()
{
	//Do not add custom code between
	//GUI Items Creation Start and GUI Items Creation End
	//wxDev-C++ designer will remove them.
	//Add the custom code before or after the blocks
	////GUI Items Creation Start

	SetTitle(wxT("Tac"));
	SetIcon(wxNullIcon);
	SetSize(8,8,320,334);
	Center();
	

	WxButton2 = new wxButton(this, ID_WXBUTTON2, wxT("Spectate"), wxPoint(172,260), wxSize(95,29), 0, wxDefaultValidator, wxT("WxButton2"));
	WxButton2->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));

	WxButton1 = new wxButton(this, ID_WXBUTTON1, wxT("OK"), wxPoint(43,260), wxSize(89,29), 0, wxDefaultValidator, wxT("WxButton1"));
	WxButton1->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));

	wxArrayString arrayStringFor_WxListBox1;
	WxListBox1 = new wxListBox(this, ID_WXLISTBOX1, wxPoint(11,13), wxSize(290,230), arrayStringFor_WxListBox1, wxLB_SINGLE);
	WxListBox1->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
	////GUI Items Creation End
}

void Tac::OnClose(wxCloseEvent& event)
{
	Destroy();
}

/*
 * WxButton1Click
 */
void Tac::WxButton1Click(wxCommandEvent& event)
{
	TicTacToe* frame = new TicTacToe(NULL);
	frame->Show();
	Destroy();
}
